<template>
	<div class='item'
	     @click="getKeyboardValue"
	     :data-value="value">
		{{value}}
	</div>
</template>

<script>
	export default {
		name: "keyboard",
		props: ['value'],
		components: {},
		computed: {},
		data() {
			return {}
		},
		methods: {
			//点击事件处理函数
			getKeyboardValue(e) {
				//获取当前的按键的值
				let value = e.target.dataset.value
				console.log("按下的键盘值")
				console.log(e.target.dataset)
				//通过commit提交mutation---
				this.$store.commit('calculate', value)
			}
		},
		mounted() {
		}
	}
</script>

<style scoped lang="">

</style>